<?php
/**
 * @version		$Id: default.php 20196 2011-01-09 02:40:25Z ian $
 * @package		Joomla.Site
 * @subpackage	mod_latest_product
 * @copyright	Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;
?>

<ul class="latest-list-images">
	<?php foreach ($list as $item): ?>
	<li>
		<?php 
		require_once JPATH_ROOT . DS . 'jelibs/classes/util.class.php';
		
		//$file 		= JPATH_ROOT . DS . 'images/je_products/upload/' . $item->images;
		//$thumbFile 	= JPATH_ROOT . DS . 'images/je_products/thumbs/160/thumb_' . $item->images;
		
		//JEUtil::resizeImage($file, $thumbFile, 160);
		
		$pathUpload = JPATH_ROOT . DS . 'images/je_products/upload/';
		$pathThumb = JPATH_ROOT . DS . 'images/je_products/thumbs/160/';
		
		$thumb = JEUtil::thumb($item->images, $pathUpload, $pathThumb, 160, 60);
		?>
		
		<?php $location = ($item->location_name == 'all-location') ? 'Toàn Quốc' : $item->location_name; ?>
				
		<a title="<?php echo $location . ': ' . $item->name; ?>" href="<?php echo JRoute::_(JE_ProductHelperRoute::getDetailRoute($item->id, $item->catid, $item->alias)); ?>">
			<span class="img">
				<img alt="<?php echo $item->alias; ?>" src="images/je_products/thumbs/160/<?php echo $thumb[0] ?>">
			</span>
			<strong><?php echo $location; ?></strong>: <?php echo JHtml::_('string.truncate', $item->name, 70);?>
			<span class="expire">(Kết thúc: <?php echo date('d/m/Y', strtotime($item->publish_down)); ?>)</span>
		</a>
	</li>
	<?php endforeach; ?>
</ul>

<div class="clr"></div>